Optimal. Leaf size=63 \[ a^2 x-\frac {5 a^2 \cos (c+d x)}{3 d (1-\sin (c+d x))}+\frac {a^4 \cos (c+d x)}{3 d (a-a \sin (c+d x))^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.15, antiderivative size = 63, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {2948, 2837,
2814, 2727} \begin {gather*} \frac {a^4 \cos (c+d x)}{3 d (a-a \sin (c+d x))^2}-\frac {5 a^2 \cos (c+d x)}{3 d (1-\sin (c+d x))}+a^2 x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2727
Rule 2814
Rule 2837
Rule 2948
Rubi steps
\begin {align*} \int \sec ^2(c+d x) (a+a \sin (c+d x))^2 \tan ^2(c+d x) \, dx &=a^4 \int \frac {\sin ^2(c+d x)}{(a-a \sin (c+d x))^2} \, dx\\ &=\frac {a^4 \cos (c+d x)}{3 d (a-a \sin (c+d x))^2}+\frac {1}{3} a^2 \int \frac {-2 a-3 a \sin (c+d x)}{a-a \sin (c+d x)} \, dx\\ &=a^2 x+\frac {a^4 \cos (c+d x)}{3 d (a-a \sin (c+d x))^2}-\frac {1}{3} \left (5 a^3\right ) \int \frac {1}{a-a \sin (c+d x)} \, dx\\ &=a^2 x+\frac {a^4 \cos (c+d x)}{3 d (a-a \sin (c+d x))^2}-\frac {5 a^3 \cos (c+d x)}{3 d (a-a \sin (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 79, normalized size = 1.25 \begin {gather*} \frac {a^2 \tan ^{-1}(\tan (c+d x))}{d}-\frac {2 a^2 \sec (c+d x)}{d}+\frac {2 a^2 \sec ^3(c+d x)}{3 d}-\frac {a^2 \tan (c+d x)}{d}+\frac {2 a^2 \tan ^3(c+d x)}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.16, size = 114, normalized size = 1.81
method | result | size |
risch | \(a^{2} x -\frac {2 \left (-9 i a^{2} {\mathrm e}^{i \left (d x +c \right )}+6 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-5 a^{2}\right )}{3 \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )^{3} d}\) | \(61\) |
derivativedivides | \(\frac {\frac {a^{2} \left (\sin ^{3}\left (d x +c \right )\right )}{3 \cos \left (d x +c \right )^{3}}+2 a^{2} \left (\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )}-\frac {\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}\right )+a^{2} \left (\frac {\left (\tan ^{3}\left (d x +c \right )\right )}{3}-\tan \left (d x +c \right )+d x +c \right )}{d}\) | \(114\) |
default | \(\frac {\frac {a^{2} \left (\sin ^{3}\left (d x +c \right )\right )}{3 \cos \left (d x +c \right )^{3}}+2 a^{2} \left (\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )}-\frac {\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}\right )+a^{2} \left (\frac {\left (\tan ^{3}\left (d x +c \right )\right )}{3}-\tan \left (d x +c \right )+d x +c \right )}{d}\) | \(114\) |
norman | \(\frac {a^{2} x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a^{2} x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-a^{2} x +\frac {8 a^{2}}{3 d}+\frac {2 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {16 a^{2} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {44 a^{2} \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {16 a^{2} \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {2 a^{2} \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+2 a^{2} x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-2 a^{2} x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-a^{2} x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {8 a^{2} \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {8 a^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {40 a^{2} \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}\) | \(280\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.51, size = 71, normalized size = 1.13 \begin {gather*} \frac {a^{2} \tan \left (d x + c\right )^{3} + {\left (\tan \left (d x + c\right )^{3} + 3 \, d x + 3 \, c - 3 \, \tan \left (d x + c\right )\right )} a^{2} - \frac {2 \, {\left (3 \, \cos \left (d x + c\right )^{2} - 1\right )} a^{2}}{\cos \left (d x + c\right )^{3}}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 141 vs.
\(2 (58) = 116\).
time = 0.36, size = 141, normalized size = 2.24 \begin {gather*} -\frac {6 \, a^{2} d x - {\left (3 \, a^{2} d x + 5 \, a^{2}\right )} \cos \left (d x + c\right )^{2} + a^{2} + {\left (3 \, a^{2} d x - 4 \, a^{2}\right )} \cos \left (d x + c\right ) - {\left (6 \, a^{2} d x - a^{2} + {\left (3 \, a^{2} d x - 5 \, a^{2}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{3 \, {\left (d \cos \left (d x + c\right )^{2} - d \cos \left (d x + c\right ) + {\left (d \cos \left (d x + c\right ) + 2 \, d\right )} \sin \left (d x + c\right ) - 2 \, d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.57, size = 67, normalized size = 1.06 \begin {gather*} \frac {3 \, {\left (d x + c\right )} a^{2} + \frac {2 \, {\left (3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 9 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 4 \, a^{2}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}^{3}}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 9.29, size = 102, normalized size = 1.62 \begin {gather*} a^2\,x+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {a^2\,\left (9\,d\,x-18\right )}{3}-3\,a^2\,d\,x\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {a^2\,\left (9\,d\,x-6\right )}{3}-3\,a^2\,d\,x\right )-\frac {a^2\,\left (3\,d\,x-8\right )}{3}+a^2\,d\,x}{d\,{\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )}^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________